<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
</head>
<body>
 
<div>计数：<span id="res"> </span></div>
<button onclick="startWorker()">开始工作</button> 
<button onclick="stopWorker()">停止工作</button>
<!-- // 动态创建Web Worker -->
<script>
    function demo() {
        console.log('大伟聊前端');
    }
    let blob = new Blob([demo.toString() + ' demo()'], {type: 'text/javascript'});
    console.log(blob.text())
    let worker = new Worker(URL.createObjectURL(blob));

    
</script>
 
</body>
</html>
